/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

// These mobile children are hidden in everything but mobile view.
.ouiSideNav__mobileToggle {
  height: auto;
  border-bottom: $ouiBorderThin;
  width: 100%;
  text-align: left;
  border-radius: 0 !important; // sass-lint:disable-line no-important
  font-size: $ouiFontSizeM;
  padding: 0 $ouiSize; // This plus the inner padding is equal to paddingSize large for OuiPage

  .ouiSideNav__mobileToggleText {
    padding: $ouiSize 0;
  }

  .ouiSideNav__mobileToggleContent {
    justify-content: space-between;
  }
}

.ouiSideNav__heading {
  margin-bottom: $ouiSizeL;
}

// Loop through the breakpoints and apply mobile styles only to the right className
@each $breakpoint in $ouiBreakpointKeys {
  @include ouiBreakpoint($breakpoint) {
    .ouiSideNav__contentMobile-#{$breakpoint} {
      overflow: hidden;
      visibility: hidden;
      opacity: 0;
      max-height: 0;
      padding: 0 $ouiSizeL;

      .ouiSideNav-isOpenMobile & {
        visibility: visible;
        opacity: 1;
        padding: $ouiSizeL;
        max-height: 5000px; /* 1 */

        @include ouiCanAnimate {
          transition: all $ouiAnimSpeedNormal $ouiAnimSlightResistance;
        }
      }
    }
  }
}
